local weaponDefs = {
  -- TANK CANNONS

  C_CANNON_TANK_LIGHT = {
    name                    = "Light Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 420,
    reloadTime              = 1.7,
    areaOfEffect            = 32,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 550,
    accuracy                = 200,
    movingAccuracy          = 400,

    soundStart              = "canlite2",  --"cannon3",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL15",
    --explosionGenerator      = "custom:LIGHTARMS",

    damage = {
      default = 200,  --DPS: 200 / 1.7 = 118
    },

    customParams = {
      armorPenetration   = 200,
      impactDamage = {
        default = 150,
      },
      
      badTargetCategory  = [[HELICOPTER]],
      onlyTargetCategory = [[BUILDING TANK SHIP HELICOPTER]],
    },
  },

  C_CANNON_TANK_HEAVY = {
    name                    = "Heavy Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,	  
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 450,	  
    reloadTime              = 3.5,
    burst                   = 2,
    burstRate               = 0.5,	  
    areaOfEffect            = 64,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,	  
    impulseBoost            = 0.1,

    weaponVelocity          = 550,	  
    accuracy                = 300,
    movingAccuracy          = 500,  

    soundStart              = "canlite1",  --"cannon3",
    soundHit                = "xplomed2",
	  
    explosionGenerator      = "custom:PLASMABALL25",
    --explosionGenerator      = "custom:LIGHTARMS",

    damage = {
      default = 300,  --DPS: 300 * 2 / 3.5 = 171
    },

    customParams = {
      armorPenetration   = 350,  --300
      impactDamage = {
        default = 300,
      },
      
      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],      
    },	
  },
  
  C_CANNON_TANK_VERY_HEAVY = {
    name                    = "Very Heavy Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,	  
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],
    intensity               = 1.0,

    range                   = 480,	  
    reloadTime              = 4.0,
    burst                   = 2,
    burstRate               = 0.7,	  
    areaOfEffect            = 80,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,	  
    impulseBoost            = 0.1,

    weaponVelocity          = 550,	  
    accuracy                = 300,
    movingAccuracy          = 500,  

    soundStart              = "canlite1",  --"cannon3",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL25",  
    --explosionGenerator      = "custom:LIGHTARMS",

    damage = {
      default = 440,  --DPS: 440 * 2 / 4.0 = 220
    },

    customParams = {
      armorPenetration   = 450,  --300
      impactDamage = {
        default = 440,
      },
      
      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],      
    },	
  },  
  
  C_CANNON_STATIONARY = {
    name                    = "Stationary Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,	  
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],
    intensity               = 1.0,

    range                   = 700,	--650  
    reloadTime              = 1.3,
    areaOfEffect            = 48,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,	  
    impulseBoost            = 0.1,

    weaponVelocity          = 550,	  
    accuracy                = 200,

    soundStart              = "cannon3",  --"cannon1",
    soundHit                = "xplomed2",
	  
    explosionGenerator      = "custom:PLASMABALL25",
    --explosionGenerator      = "custom:LIGHTARMS",

    damage = {
      default = 250,  --DPS: 250 / 1.3 = 192
    },

    customParams = {
      armorPenetration   = 300,
      impactDamage = {
        default = 250,
      },
    },	
  },

  -- NAVAL CANNONS

  C_CANNON_BOAT = {
    name                    = "Very Light Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 500,
    reloadTime              = 2.0,
    areaOfEffect            = 32,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 400,
    accuracy                = 300,
    movingAccuracy          = 500,

    soundStart              = "cannon3",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL15",

    damage = {
      default = 100,  --DPS: 100 / 2.0 = 50
    },

    customParams = {
      armorPenetration   = 100,
      impactDamage = {
        default = 100,
      },
    },
  },

  C_CANNON_DESTROYER_1BARREL = {
    name                    = "Light Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 700,
    reloadTime              = 3.0,  --1B: 3.0  2B: 1.8
    areaOfEffect            = 48,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 450,
    accuracy                = 300,
    movingAccuracy          = 500,

    soundStart              = "cannon3",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL25",

    damage = {
      default = 200,  --DPS: 200 / 3.0 = 67
    },

    customParams = {
      armorPenetration   = 150,
      impactDamage = {
        default = 200,
      },

      badTargetCategory  = [[HELICOPTER]],
      onlyTargetCategory = [[BUILDING TANK SHIP HELICOPTER]],
      
      numberOfBarrels  = 1,
      barrelsPenalty   = 0.5,
    },
  },

  C_CANNON_CRUISER = {
    name                    = "Cruiser Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,

    range                   = 1100,
    reloadTime              = 2.7,  --1B: 4.5  2B: 2.7
    areaOfEffect            = 64,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 500,
    accuracy                = 500,
    movingAccuracy          = 700,

    soundStart              = "cannhvy1",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL35",

    damage = {
      default = 350,  --DPS: 350 / 2.7 = 130
    },

    customParams = {
      armorPenetration   = 250,
      impactDamage = {
        default = 350,
      },
      
      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],      
    },
  },

    
  C_CANNON_BATTLECRUISER = {
    name                    = "Battlecruiser Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 1300,
    reloadTime              = 3.3,  --1B: 5.5  2B: 3.3
    areaOfEffect            = 80,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 550,
    accuracy                = 600,
    movingAccuracy          = 800,

    soundStart              = "cannhvy1",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL45",

    damage = {
      default = 500,  --DPS: 500 / 3.3 = 152
    },

    customParams = {
      armorPenetration   = 350,
      impactDamage = {
        default = 500,
      },

      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],
      
      numberOfBarrels  = 2,
    },
  },
  
  C_CANNON_BATTLESHIP = {
    name                    = "Battleship Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,

    range                   = 1500,
    reloadTime              = 3.0,  --1B: 7.0  3B: 3.0
    areaOfEffect            = 96,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 600,
    accuracy                = 700,
    movingAccuracy          = 900,

    soundStart              = "cannhvy1",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL55",

    damage = {
      default = 650,  --DPS: 650 / 3.0 = 217
    },

    customParams = {
      armorPenetration   = 450,
      impactDamage = {
        default = 650,
      },
      
      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],      
    },
  },

  C_CANNON_MONITOR = {
    name                    = "Monitor Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,

    range                   = 1400,
    reloadTime              = 4.5,  --1B: 7.5  2B: 4.5
    areaOfEffect            = 96,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 550,
    accuracy                = 1000,
    movingAccuracy          = 1200,

    soundStart              = "cannhvy1",
    soundHit                = "xplomed2",

    explosionGenerator      = "custom:PLASMABALL55",

    damage = {
      default = 600,  --DPS: 600 / 4.5 = 133
    },

    customParams = {
      armorPenetration   = 300,
      impactDamage = {
        default = 600,
      },
      
      badTargetCategory  = [[TANK]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],
    },
  },   

  C_CANNON_ARTILLERY_1BARREL = {
    name                    = "Light Artillery",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,
    noSelfDamage            = true,

    rgbColor                = [[0.5 0.5 0.5]],  -- [[0.7 0.7 0]],  --yellow
    intensity               = 1.0,
	
    range                   = 1000,
    reloadTime              = 3.8,
    areaOfEffect            = 48,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,
    impulseBoost            = 0.1,

    weaponVelocity          = 400,
    accuracy                = 400,  -- 400 + 700 = 1100
    movingAccuracy          = 800,  -- 800 + 700 = 1500
    sprayAngle              = 700,

    soundStart              = "cannon2",
    soundHit                = "xplosml4",  --"xplomed4",

    explosionGenerator      = "custom:PLASMABALL25",

    damage = {
      default = 200,  --DPS: 200 / 3.8 = 53
    },

    customParams = {
      armorPenetration   = 100,
      impactDamage = {
        default = 200,
      },
      
      badTargetCategory  = [[TANK]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],
      
      supportedAccuracy  = 200,  -- 200 + 700 = 900

      numberOfBarrels    = 1,
      
      rangeColor         = "ARTY",
    },
  },

  C_CANNON_EXPERIMENTAL = {
    name                    = "Super Heavy Cannon",
    weaponType              = "Cannon",
    turret                  = true,
    gravityAffected         = true,	  
    noSelfDamage            = true,
	
    rgbColor                = [[0.5 0.5 0.5]],
    intensity               = 1.0,

    range                   = 600,	  
    reloadTime              = 4.0,
    areaOfEffect            = 112,
    craterBoost             = 0,
    craterMult              = 0,
    impulseFactor           = 0.1,	  
    impulseBoost            = 0.1,

    weaponVelocity          = 500,	  
    accuracy                = 800,
    movingAccuracy          = 1000,  

    soundStart              = "xplonuk4",
    soundHit                = "xplolrg3",

    explosionGenerator      = "custom:PLASMABALL55",  

    damage = {
      default = 1400,  --1900 --DPS: 1400 / 4.0 = 350
    },

    customParams = {
      armorPenetration   = 500,
      impactDamage = {
        default = 1900,
      },
      
      badTargetCategory  = [[BUILDING]],
      onlyTargetCategory = [[BUILDING TANK SHIP]],      
    },	
  },  
}
  
--explosiongenerator=custom:BIGFIREBALL,
--explosiongenerator=custom:BIGFIREBALL_W,

Shared.weaponDefs = weaponDefs
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_DESTROYER_2BARRELS", "Double Light Cannon"   , 2, "C_CANNON_DESTROYER_1BARREL")  --DPS: 200 / 1.8 = 111
Shared.CreateWeaponWithMoreBarrels ("C_CANNON_ARTILLERY_2BARRELS", "Double Light Artillery", 2, "C_CANNON_ARTILLERY_1BARREL", 0.5)  --DPS: 200 * 2 / 3.8 = 105

return lowerkeys(weaponDefs)